package com.miniapp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 业务文件关联表
 * </p>
 *
 * @author yourName
 * @since 2025-09-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_business_file")
public class BusinessFile implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 业务编码(关联具体业务的唯一标识)
     */
    @TableField("business_code")
    private String businessCode;

    /**
     * 业务类型(如:ORDER-订单,USER-用户,RESERVATION-预约)
     */
    @TableField("business_type")
    private String businessType;

    /**
     * 基础文件ID(关联base_file表)
     */
    @TableField("base_file_id")
    private Long baseFileId;

    /**
     * 排序号
     */
    @TableField("sort")
    private Integer sort;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 是否删除(0-未删,1-已删)
     */
    @TableField("is_deleted")
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 基础文件信息(非数据库字段,用于关联查询)
     */
    @TableField(exist = false)
    private BaseFile baseFile;
}
